<template>
   <div class="goodlist">
      <!-- v-for遍历对象数组，把具体的对象丢给子组件 -->
      <goods-list-item  v-for="item in goods" :key="item.id" :goodsItem="item"></goods-list-item>
   </div>
</template>

<script>
import GoodsListItem from './GoodsListItem.vue'

export default {
  components: { GoodsListItem },

   props: {
      goods: {
         type: Array,
         default(){
            return []
         }
      },
    
   },
}
</script>

<style>
.goodlist{
   display: flex;
   /* 换行方式 */
   flex-wrap: wrap;
   /* 主轴对齐方式 */
   justify-content:space-around;
   padding: 2px
}
</style>